/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.mygameframework.sprite;

//import common.messaging.Telegram;

import com.mygameframework.util.Vector2D;
import java.awt.Graphics2D;


/**
 *
 * @author bill
 */
public abstract class BaseGameEntity {
    private int id=nextId++;
    private  static int nextId=0;
    Vector2D position;

    public BaseGameEntity() {
    }
    
    
//    public BaseGameEntity(){
//        new BaseGameEntity(nextId);
//    }
//    public BaseGameEntity(int id){
//        setId(id);
//    }
    public void setId(int id){
          assert ( (id >= nextId) && "<BaseGameEntity::SetID>: invalid ID"!=null);
        this.id=id;
//        nextId=id+1;
    }
    public int getId(){
        return this.id;
    }
    protected static int getNextId(){
        return nextId;
    }
    public abstract void update(long elapsedTime);
    public abstract void render(Graphics2D g);
//    public abstract boolean handleMessage(Telegram msg);
}
